<template>
    <el-dialog
        v-model="dialogVisible"
        title="预览"
        width="500"
        fullscreen
    >
        <div v-html="props.html"></div>
</el-dialog>
</template>

<script setup>
    import {ref} from 'vue'

    const dialogVisible = ref(false)
    const props = defineProps({
        html: {
            type: String,
            deep: true,
            default: ''
        }
    })

    const showdialog = (val) => {
        dialogVisible.value = val ? val : !dialogVisible.value
    }

    defineExpose({
        showdialog
    })
</script>